﻿<?php get_header(); ?>
<div id="contentarea">
	<div class="wide">
		<?php include (TEMPLATEPATH . '/ing.php'); ?>

		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
			<?php if (is_search()) { ?>
				<div class="pointout"><h2>Search for <span class="warn"><?php echo $s ?></span></h2></div>
			<?php } elseif (is_category()) { ?>
				<div class="pointout"><h2>Category Page</h2></div>
			<?php } ?>
			<div class="<?php if (!is_page()) { ?>postinfo<?php } else { ?>pointout<?php } ?>">
				<h2 id="post-<?php the_ID();?>">
				<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
				</h2>
			<?php if (!is_page()) { ?>
				<span class="alignleft">Date: <?php the_time("m/d/Y") ?> Tag: <?php the_category(',') ?> <?php edit_post_link(__('Edit This')); ?></span>
				<span class="alignright"><?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?></span>
			<?php } ?>
			</div>
			<?php if (is_search() or is_category()) {
				the_excerpt();
			} else { 
				the_content(__('(more...)')); 
			}
			?>

		<?php endwhile; else: ?>
		<div class="postinfo">
			<h2><?php _e('Not Found'); ?></h2>
			<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
		</div>
		<?php endif; ?>

		<div class="Nav">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
			<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
			<div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
<?php } ?>
		</div>
	</div>
	<?php get_sidebar(); ?>		
</div>	
<?php get_footer(); ?>